package com.liujit.pay.wx.enums;

import cn.hutool.core.util.StrUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @description: 退款状态
 * @author: liujun
 * @create: 2021/2/19 2:23 下午
 **/
@Getter
@AllArgsConstructor
public enum RefundsStatus {
    /**
     * 退款成功
     */
    SUCCESS("SUCCESS","退款成功"),
    /**
     * 退款关闭
     */
    CLOSED("CLOSED","退款关闭"),
    /**
     * 退款处理中
     */
    PROCESSING("PROCESSING","退款处理中"),
    /**
     * 退款异常
     */
    ABNORMAL("ABNORMAL","退款异常");

    private String status;

    private String name;

    public static String getName(String status) {
        for (RefundsStatus refundsStatus : RefundsStatus.values()) {
            if (StrUtil.equals(status, refundsStatus.getStatus())) {
                return refundsStatus.getName();
            }
        }
        return null;
    }
}
